<template>
  <div class="moren">
    <ul>
        <li v-for="(item) in list" :key="item">
            <template v-if="item.id%2!=0">
                <img src="../../assets/doubi.png" alt="">
                <div style="display:flex">
                   <button style="color:#575757;background-color:#ffe588;width: 98px;height: 30px;">拉票</button> <button style="color:#e41b25;background-color:#fcca8d;width: 98px;height: 30px;">投票</button>
                </div>
                
                <p>{{item.id}}</p>
                <h4>{{item.username}}</h4>
                <h4>{{item.votes}}票</h4>
            </template>
        </li>
    </ul>
    <ul>
        <li v-for="(item) in list" :key="item">
            <template v-if="item.id%2==0">
                <img src="../../assets/doubi.png" alt="">
                <div style="display:flex">
                   <button style="color:#575757;background-color:#ffe588;width: 98px;height: 30px;">拉票</button> <button style="color:#e41b25;background-color:#fcca8d;width: 98px;height: 30px;">投票</button>
                </div>
                
                <p>{{item.id}}</p>
                <h4>{{item.username}}</h4>
                <h4>{{item.votes}}票</h4>
            </template>
        </li>
    </ul>
  </div>
</template>

<script>
import list from "../../assets/list.js";
export default {
name:'MoRen',
data(){
return{
    list,
}
}
}
</script>

<style scoped>
li{
    list-style: none;
    width: 196px;
    height: 330;
    margin-top: 20px;
    text-align: center;
}
.moren{
    display: flex;
}
p{
    width: 42px;
    height: 24px;
    background-color: #c40f18;
    color: #fdd48e;
    margin: auto auto;
    position: relative;
    bottom: 120px;
}
h4{
    color: #575757;
    margin: auto auto;
    position: relative;
    bottom: 120px; 
}
</style>